<script lang="ts" setup>
import {useRoute} from 'vue-router';
import {ref} from "vue";
const route = useRoute();
let id = route.params.id;
const idRef = ref(route.params.id);

const updateValue=()=>{
  id = Math.random()+'';
  idRef.value = Math.random()+'';
}
</script>

<template>
<h4>demo18-route-child01c.vue</h4>
  <p>id:{{$route.params.id}}</p>
  <p>id方式二：{{id}}</p>
  <p @click="updateValue()">id方式三：{{idRef}}</p>
</template>

<style scoped>

</style>
